package Tests;

import java.lang.reflect.*;  

public class Ref04_ReflectionTeste {  
  
    public static void main(String args[]) {  
        try {  
            Class c = Class.forName( "java.lang.String" );  
            Method m[] = c.getDeclaredMethods();  
            for (int i = 0; i < m.length; i++) {  
            System.out.println( m[i].toString() );  
            
            Class cls = Class.forName("java.lang.String");  
            
            boolean b1 = cls.isInstance(new Integer(37));  
            System.out.println(b1);  
              
            boolean b2 = cls.isInstance(new java.lang.String("teste"));  
            System.out.println(b2); 
        }  
    }  
        catch (Throwable e) {  
            System.err.println(e);  
        }  
    }  
} 